<!--
 * @Date: 2023-03-10 11:23:56
 * @LastEditors: wkl
 * @LastEditTime: 2023-04-27 19:19:19
 * @FilePath: /demo/demos.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <title>Strve.js</title>
</head>

<body>
    <script type="module">
        import {
            h,
            setData,
            createApp,
        } from 'https://cdn.jsdelivr.net/npm/strve-js@5.1.1/dist/strve.full-esm.js';

        const state = {
            count: 0,
        };

        function add() {
            setData(() => {
                state.count++;
            });
        }

        function App() {
            return h`
						<h1 $key>${state.count}</h1>
						<button onClick=${add}>Add</button> 
				`;
        }

        const app = createApp(App);
        app.mount('#app');
    </script>
</body>

</html>